BEGIN
  DECLARE curTabla CURSOR LOCAL FOR 
    SELECT   LOWER(column_name), UPPER(data_type), isNull(character_Maximum_length,0),
             is_nullable, 'NO' as Ordenar, ordinal_Position
    FROM     INFORMATION_SCHEMA.COLUMNS
    WHERE    table_name = 'NomTabla'
    ORDER BY ordinal_Position;
    
  DECLARE @vCampo AS VARCHAR(30),@vTipo AS VARCHAR(30), @vTamanio AS VARCHAR(30),
		  @vNulo AS VARCHAR(3), @vOrdenar AS VARCHAR(2), @vPosicion as INT; 
  OPEN curTabla;
  
  FETCH curTabla INTO @vCampo, @vTipo, @vTamanio,
					  @vNulo, @vOrdenar, @vPosicion;
  
  WHILE @@FETCH_STATUS=0
  BEGIN
	IF @vNulo='YES'
	BEGIN
	  SET @vNulo='SI';
	END
	
	print @vCampo+N'='+@vTipo+N'='+@vTamanio+N'='+@vNulo+N'='+@vOrdenar;
    FETCH curTabla INTO @vCampo, @vTipo, @vTamanio,
					    @vNulo, @vOrdenar, @vPosicion;
  END

END;